return new_context;
}
-GdkDragProtocol
-_gdk_broadway_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- return GDK_DRAG_PROTO_NONE;
-}
-
static GdkWindow *
gdk_broadway_drag_context_find_window (GdkDragContext *context,
GdkWindow *drag_window,
void _gdk_broadway_display_init_dnd (GdkDisplay *display);
GdkDisplay * _gdk_broadway_display_open (const gchar *display_name);
void _gdk_broadway_display_queue_events (GdkDisplay *display);
-GdkDragProtocol _gdk_broadway_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target);
GdkCursor*_gdk_broadway_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
GdkCursor *_gdk_broadway_display_get_cursor_for_texture (GdkDisplay *display,
impl_class->get_property = _gdk_broadway_window_get_property;
impl_class->change_property = _gdk_broadway_window_change_property;
impl_class->delete_property = _gdk_broadway_window_delete_property;
- impl_class->get_drag_protocol = _gdk_broadway_window_get_drag_protocol;
}
return context->dest_window;
}
-/**
- * gdk_drag_context_get_protocol:
- * @context: a #GdkDragContext
- *
- * Returns the drag protocol thats used by this context.
- *
- * Returns: the drag protocol
- *
- * Since: 3.0
- */
-GdkDragProtocol
-gdk_drag_context_get_protocol (GdkDragContext *context)
-{
- g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_DRAG_PROTO_NONE);
-
- return context->protocol;
-}
-
/**
* gdk_drag_context_set_device:
* @context: a #GdkDragContext
G_TYPE_NONE, 1, GDK_TYPE_DRAG_ACTION);
}
-/**
+/*
* gdk_drag_find_window:
* @context: a #GdkDragContext
* @drag_window: a window which may be at the pointer position, but
GDK_DRAG_CANCEL_ERROR
} GdkDragCancelReason;
-/**
- * GdkDragProtocol:
- * @GDK_DRAG_PROTO_NONE: no protocol.
- * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
- * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
- * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
- * unclaimed root window drops.
- * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
- * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
- * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
- * @GDK_DRAG_PROTO_WAYLAND: Wayland DND protocol.
- *
- * Used in #GdkDragContext to indicate the protocol according to
- * which DND is done.
- */
-typedef enum
-{
- GDK_DRAG_PROTO_NONE = 0,
- GDK_DRAG_PROTO_MOTIF,
- GDK_DRAG_PROTO_XDND,
- GDK_DRAG_PROTO_ROOTWIN,
- GDK_DRAG_PROTO_WIN32_DROPFILES,
- GDK_DRAG_PROTO_OLE2,
- GDK_DRAG_PROTO_LOCAL,
- GDK_DRAG_PROTO_WAYLAND
-} GdkDragProtocol;
-
-
GDK_AVAILABLE_IN_ALL
GType gdk_drag_context_get_type (void) G_GNUC_CONST;
GdkWindow *gdk_drag_context_get_source_window (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_drag_context_get_dest_window (GdkDragContext *context);
-GDK_AVAILABLE_IN_ALL
-GdkDragProtocol gdk_drag_context_get_protocol (GdkDragContext *context);
/* Destination side */
GDK_AVAILABLE_IN_ALL
gint x_root,
gint y_root);
-GDK_AVAILABLE_IN_ALL
-void gdk_drag_find_window (GdkDragContext *context,
- GdkWindow *drag_window,
- gint x_root,
- gint y_root,
- GdkWindow **dest_window,
- GdkDragProtocol *protocol);
-
GDK_AVAILABLE_IN_ALL
gboolean gdk_drag_drop_succeeded (GdkDragContext *context);
G_BEGIN_DECLS
+/*
+ * GdkDragProtocol:
+ * @GDK_DRAG_PROTO_NONE: no protocol.
+ * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
+ * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
+ * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
+ * unclaimed root window drops.
+ * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
+ * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
+ * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
+ * @GDK_DRAG_PROTO_WAYLAND: Wayland DND protocol.
+ *
+ * Used in #GdkDragContext to indicate the protocol according to
+ * which DND is done.
+ */
+typedef enum
+{
+ GDK_DRAG_PROTO_NONE = 0,
+ GDK_DRAG_PROTO_MOTIF,
+ GDK_DRAG_PROTO_XDND,
+ GDK_DRAG_PROTO_ROOTWIN,
+ GDK_DRAG_PROTO_WIN32_DROPFILES,
+ GDK_DRAG_PROTO_OLE2,
+ GDK_DRAG_PROTO_LOCAL,
+ GDK_DRAG_PROTO_WAYLAND
+} GdkDragProtocol;
+
#define GDK_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
#define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
#define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
void gdk_drag_drop (GdkDragContext *context,
guint32 time_);
+void gdk_drag_find_window (GdkDragContext *context,
+ GdkWindow *drag_window,
+ gint x_root,
+ gint y_root,
+ GdkWindow **dest_window,
+ GdkDragProtocol *protocol);
+
G_END_DECLS
#include "gdkdisplay.h"
#include "gdkeventsprivate.h"
#include "gdkenumtypes.h"
+#include "gdkdndprivate.h"
G_BEGIN_DECLS
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->register_dnd (window);
}
-/**
- * gdk_window_get_drag_protocol:
- * @window: the destination window
- * @target: (out) (allow-none) (transfer full): location of the window
- * where the drop should happen. This may be @window or a proxy window,
- * or %NULL if @window does not support Drag and Drop.
- *
- * Finds out the DND protocol supported by a window.
- *
- * Returns: the supported DND protocol.
- *
- * Since: 3.0
- */
-GdkDragProtocol
-gdk_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_DRAG_PROTO_NONE);
-
- return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_drag_protocol (window, target);
-}
-
/**
* gdk_drag_begin:
* @window: the source window for this drag.
GDK_AVAILABLE_IN_ALL
void gdk_window_register_dnd (GdkWindow *window);
-GDK_AVAILABLE_IN_ALL
-GdkDragProtocol
- gdk_window_get_drag_protocol(GdkWindow *window,
- GdkWindow **target);
-
GDK_AVAILABLE_IN_ALL
void gdk_window_begin_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
void (* set_opacity) (GdkWindow *window,
gdouble opacity);
void (* destroy_notify) (GdkWindow *window);
- GdkDragProtocol (* get_drag_protocol) (GdkWindow *window,
- GdkWindow **target);
void (* register_dnd) (GdkWindow *window);
GdkDragContext * (*drag_begin) (GdkWindow *window,
GdkDevice *device,
{
}
-static GdkDragProtocol
-gdk_mir_window_impl_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- return 0;
-}
-
static void
gdk_mir_window_impl_register_dnd (GdkWindow *window)
{
impl_class->configure_finished = gdk_mir_window_impl_configure_finished;
impl_class->set_opacity = gdk_mir_window_impl_set_opacity;
impl_class->destroy_notify = gdk_mir_window_impl_destroy_notify;
- impl_class->get_drag_protocol = gdk_mir_window_impl_get_drag_protocol;
impl_class->register_dnd = gdk_mir_window_impl_register_dnd;
impl_class->drag_begin = gdk_mir_window_impl_drag_begin;
impl_class->process_updates_recurse = gdk_mir_window_impl_process_updates_recurse;
context_class->commit_drag_status = gdk_wayland_drag_context_commit_status;
}
-GdkDragProtocol
-_gdk_wayland_window_get_drag_protocol (GdkWindow *window, GdkWindow **target)
-{
- return GDK_DRAG_PROTO_WAYLAND;
-}
-
void
_gdk_wayland_window_register_dnd (GdkWindow *window)
{
guint *next_image_delay);
void gdk_wayland_window_sync (GdkWindow *window);
-GdkDragProtocol _gdk_wayland_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target);
void _gdk_wayland_window_register_dnd (GdkWindow *window);
GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window,
impl_class->begin_move_drag = gdk_wayland_window_begin_move_drag;
impl_class->set_opacity = gdk_wayland_window_set_opacity;
impl_class->destroy_notify = gdk_wayland_window_destroy_notify;
- impl_class->get_drag_protocol = _gdk_wayland_window_get_drag_protocol;
impl_class->register_dnd = _gdk_wayland_window_register_dnd;
impl_class->drag_begin = _gdk_wayland_window_drag_begin;
impl_class->get_property = gdk_wayland_window_get_property;
}
}
-/* Untested, may not work ...
- * ... but as of this writing is only used by exlusive X11 gtksocket.c
- */
-GdkDragProtocol
-_gdk_win32_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- GdkDragProtocol protocol = GDK_DRAG_PROTO_NONE;
-
- if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN)
- {
- if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
- {
- if (use_ole2_dnd)
- protocol = GDK_DRAG_PROTO_OLE2;
- else
- protocol = GDK_DRAG_PROTO_LOCAL;
- }
- }
-
- if (target)
- {
- *target = NULL;
- }
-
- return protocol;
-}
-
typedef struct {
gint x;
gint y;
void _gdk_win32_selection_init (void);
void _gdk_win32_dnd_exit (void);
-GdkDragProtocol _gdk_win32_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target);
-
void gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data);
void gdk_win32_handle_table_remove (HANDLE handle);
impl_class->begin_move_drag = gdk_win32_window_begin_move_drag;
impl_class->set_opacity = gdk_win32_window_set_opacity;
impl_class->destroy_notify = gdk_win32_window_destroy_notify;
- impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol;
impl_class->register_dnd = _gdk_win32_window_register_dnd;
impl_class->drag_begin = _gdk_win32_window_drag_begin;
impl_class->get_property = _gdk_win32_window_get_property;
g_object_unref (window);
}
-static GdkDragProtocol
-gdk_x11_window_get_drag_protocol (GdkWindow *window,
- GdkWindow **target)
-{
- GdkDragProtocol protocol;
- GdkDisplay *display;
- guint version;
- Window xid;
-
- display = gdk_window_get_display (window);
- xid = _gdk_x11_display_get_drag_protocol (display,
- GDK_WINDOW_XID (window->impl_window),
- &protocol,
- &version);
-
- if (target)
- {
- if (xid != None)
- *target = gdk_x11_window_foreign_new_for_display (display, xid);
- else
- *target = NULL;
- }
-
- return protocol;
-}
-
static void
update_wm_hints (GdkWindow *window,
gboolean force)
impl_class->begin_move_drag = gdk_x11_window_begin_move_drag;
impl_class->set_opacity = gdk_x11_window_set_opacity;
impl_class->destroy_notify = gdk_x11_window_destroy_notify;
- impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
impl_class->register_dnd = _gdk_x11_window_register_dnd;
impl_class->drag_begin = _gdk_x11_window_drag_begin;
impl_class->get_property = _gdk_x11_window_get_property;